#!/usr/bin/perl
use strict;
# use warnings;
open FILE, "@ARGV";
while((my $line = <FILE>)&&(my $line2 = <FILE>))
{
    my @myvec1 = split(" ",$line);
    my @myvec2 = split(" ",$line2);
    my $numLoci=@myvec1;
    $numLoci-=2;
    for(my $iter=2;$iter<$numLoci+2;$iter++)
    {
	my $locus=$iter-2;
	print "$myvec1[0] $myvec1[1] $locus $myvec1[$iter] $myvec2[$iter] \n";
    }
}
